package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;

public class CopyDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fi = new FileInputStream("./111.png");
        FileOutputStream fo = new FileOutputStream("./cp2_111.png");

        byte[] num = new byte[10];
        int len;

        Long start = System.currentTimeMillis();

        while ((len = fi.read(num)) != -1){
        //    fo.write(num);
            fo.write(num,0,len);
        }
        Long end = System.currentTimeMillis();
        System.out.println("复制完毕！！！,用时"+(end-start)+"ms");

        fi.close();
        fo.close();

    }
}
